package day4;

import java.io.*;

/**
 * ClassName：TestCharStream
 *
 * @Author：小鱼
 * @Create：2025-08-21 14:37
 */
public class TestCharStreamPhoto {
    public static void main(String[] args) throws IOException {
        //实例化流对象
        File fileA =new File("D:\\IDEA_project\\JP_Java\\week6\\src\\day4\\img.png ") ;
        File fileB =new File("D:\\IDEA_project\\JP_Java\\week6\\src\\day4\\b.png");

        Reader reader = new FileReader(fileA);
        Writer writer = new FileWriter(fileB);

        //读a中内容
//        int i = reader.read();
//        System.out.println(i);
        int r = reader.read();
        while (r!=-1){
          writer.write(r);
          r = reader.read();
        }

        writer.flush();
        writer.close();
        reader.close();

    }
}
